package create

import "github.com/spf13/cobra"

var cmdByAll = &cobra.Command{
	Use:     "all",
	Short:   "Create a new model/repository/service/handler",
	Example: "goinit create all -s demo user",
	Run: func(cmd *cobra.Command, args []string) {
		if len(args) == 0 {
			cmd.Help()
			return
		}

		if args[0] == "" || moduleName == "" {
			cmd.Help()
			return
		}

		touchFile("model", cmd, args)
		touchFile("repository", cmd, args)
		touchFile("service", cmd, args)
		touchFile("handler", cmd, args)
	},
}
